import request from '@/utils/axiosRequest'
import useEnv from "@/hooks/useEnv";
const upload = useEnv.VITE_FILE_API + "/upload"
const show = useEnv.VITE_FILE_API + "/shows?uuid="

const getCategory = () => {
    return request({
        url: '/category/get'
    })
}
const add = (data) => {
    return request({
        url: '/photo/add',
        data: data,
        method: 'post'
    })
}

const getPhoto = (x) => {
    return request({
        url: '/photo/selectByVague?index=' + x.index + '&size=' + x.size + '&searchName=' + x.name + '&searchValue1=' + x.categoryId
    })
}
const like = (id) => {
    return request({
        url: '/like/like?photoId=' + id
    })
}
const isLike = (id) => {
    return request({
        url: '/like/isLike?photoId=' + id
    })
}
export default {
    upload,
    show,
    getCategory,
    add,
    getPhoto,
    like,
    isLike
}